// pages/oilRecharge/oilRecharge.js
Page({
  data: {
    cardArr: ["1050689", "1057692", "1597467", "1583496", "自定义"],//账号选择
    cdx: 0,
    invoiceArr: ["是", "否"],//是否带发票
    idx: 0,//是否带发票默认值
    isShow: false,
    btnTxt: "提交",
    currentTab: 0,
    otherPrice:"其他金额",
    aa:"",
    isHide:false //遮罩层
  },

  onLoad: function (options) {

  },
  onReady: function () {

  },
  onShow: function () {

  },
  submitData() {
    var that = this;
    that.setData({ "btnTxt": "正在提交..." })
  },
  switchTab(e) {
    var that = this;
    that.setData({ "currentTab": e.currentTarget.dataset.idx });
    if (this.data.currentTab==4){
      this.setData({
        isHide: true
      });
    }
  },
  bindPickerChangeCard(e) {
    this.setData({
      cdx: e.detail.value
    });
    if (this.data.cardArr[this.data.cdx] == "自定义") {
      this.setData({
        isShow: true
      });
    }else{
      this.setData({
        isShow: false
      });
    }
  },
  bindPickerChange(e) {
    this.setData({
      idx: e.detail.value
    });
  },
  closeModal(){
    this.setData({
      isHide: false
    });
  },
  blurInput(e){
    this.setData({
      aa: e.detail.value
    });
  },
  submitInput(e) {
    if (this.data.aa){
      this.setData({
        otherPrice: this.data.aa,
        isHide: false
      });
    }else{
      this.setData({
        isHide: false
      });
    }
  
  }
 
})